Skip to content

eds/lrs: handle nil when LRS is disabled#4086

Merged
menghanl merged 3 commits intogrpc:masterfrom
menghanl:xds_lrs_disabled
Dec 7, 2020
Merged

eds/lrs: handle nil when LRS is disabled#4086
menghanl merged 3 commits intogrpc:masterfrom
menghanl:xds_lrs_disabled

Conversation

@menghanl
Copy link
Contributor

@menghanl menghanl commented Dec 7, 2020

Checking nil before calling the methods. Even though the implementation's receiver checks for nil, the interface nil doesn't have the implementation type, and won't call the implementation's receiver.

https://play.golang.org/p/LilYpHAr84j

edsb := newEDSBalancerImpl(cc, nil, lsWrapper, nil)
edsb.enqueueChildBalancerStateUpdate = edsb.updateState

// Two localities, each with one backend.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: 1 locality now

clab1 := testutils.NewClusterLoadAssignmentBuilder(testClusterNames[0], nil)
clab1.AddLocality(testSubZones[0], 1, 0, testEndpointAddrs[:1], nil)
edsb.handleEDSResponse(parseEDSRespProtoForTesting(clab1.Build()))
sc1 := <-cc.NewSubConnCh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sc?

Comment on lines +750 to +752
// We create an xdsClientWrapper with a dummy xdsClientInterface which only
// implements the LoadStore() method to return the underlying load.Store to
// be used.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't make 100% sense anymore I think.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants